package com.iwhalecloud.bss.kite.cucc.web;

import java.util.Locale;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.i18n.LocaleContextHolder;
import org.zxp.esclientrhl.annotation.EnableESTools;

@SpringBootApplication
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@ComponentScan(value = {
    "com.ztesoft.bss.common.util",
    "com.iwhalecloud.bss.kite",
    "com.iwhalecloud.bss.unify",
    "com.ztesoft.bss.base.dataservice.impl",
    "com.ztesoft.bss.base.mgr",
//    "com.ztesoft.bss.base.cache",
    "com.ztesoft.bss.rlc.core",
    "com.ztesoft.bss.rul.core",
    "com.ztesoft.bss.rul.local"
	}, excludeFilters = @ComponentScan.Filter(type = org.springframework.context.annotation.FilterType.ASSIGNABLE_TYPE,
    classes = {com.iwhalecloud.bss.kite.web.config.InterceptorConfig.class,
        com.iwhalecloud.bss.kite.cart.common.config.CartMyBatisConfig.class
    }))
@EnableESTools(basePackages = {"com.iwhalecloud.bss.kite.cart.client.api.es.repository"},
    entityPath = {"com.iwhalecloud.bss.kite.cart.client.api.es.entity"})
public class CuccKiteWebApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(CuccKiteWebApplication.class);
    }

    public static void main(String[] args) {
        //hsf
//        PandoraBootstrap.run(args);
        SpringApplication.run(CuccKiteWebApplication.class, args);
        LocaleContextHolder.setDefaultLocale(Locale.SIMPLIFIED_CHINESE);
        // 标记服务启动完成,并设置线程 wait。防止业务代码运行完毕退出后，导致容器退出。
//        PandoraBootstrap.markStartupAndWait();
    }
}
